package com.itcast.dao;

import com.itcast.domain.Book;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface BookDao {
    @Insert("insert into book (type,name,description) values(#{type},#{name},#{description})")
 public void save(Book book);
    @Update("update book set type=#{type},name=#{name},description=#{description} where id = #{id}")
    public void update(Book book) ;
    @Delete("DELETE FROM book WHERE id = #{id}")
    public void delete(int id);
    @Select("select * from book where id = #{id}")
    public Book getById(int id) ;
    @Select("select * from book")
    public List<Book> getAll();
}
